package io.xiyou.order.api;


import io.xiyou.order.api.bo.AddOrderBO;
import io.xiyou.order.api.bo.PayOrderBO;
import io.xiyou.order.api.dto.OrderDTO;
import org.dromara.hmily.annotation.Hmily;
import org.springframework.cache.annotation.CacheConfig;

import java.util.List;

/**
 * @author 西柚
 */
@CacheConfig(cacheNames = "orders")
public interface IOrderService {

    /**
     * 创建订单
     *
     * @param addOrderBO
     */
    OrderDTO createOrder(AddOrderBO addOrderBO);

    /**
     * 批量创建订单
     */
    void batchCreateOrder();

    /**
     * 支付订单
     *
     * @param payOrderBO
     */
    @Hmily
    void payOrder(PayOrderBO payOrderBO);

    /**
     * 订单详情
     *
     * @param orderCode
     * @return
     */
    OrderDTO getOrderDetails(Long orderCode);

    /**
     * 根据用户ID查询订单列表
     *
     * @param userId
     * @return
     */
    List<OrderDTO> getByUserId(Long userId);

}
